#31 new
Trey Bean

No more formatted_* routes in edge rails

Reported by Trey Bean | January 5th, 2009 @ 04:35 PM

Rails has dropped the formatted_* routes in favor of passing in a :format option, so we need to update the generated tests/specs for Restful Authentication to use this new format.

http://rails.lighthouseapp.com/p... http://github.com/rails/rails/co...

On a fresh install, running off of the latest edge rails (ce706b4b9be03a3f2e7d11438e6550d64c5f4461), three specs fail:

1) NoMethodError in 'UsersController named routing should route user_(:id => '1') to /users/1' undefined method formatted_user_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c3cb4> ./spec/controllers/users_controller_spec.rb:152:

2) NoMethodError in 'UsersController named routing should route new_user_path() to /users/new' undefined method formatted_new_user_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c4510> ./spec/controllers/users_controller_spec.rb:146:

3) NoMethodError in 'UsersController named routing should route users_path() to /users' undefined method formatted_users_path' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_6::Subclass_3:0x21c4c40> ./spec/controllers/users_controller_spec.rb:140:

I'll write the patch here in a sec.

Comments and changes to this ticket

  • Trey Bean

    Trey Bean January 5th, 2009 @ 05:11 PM

    I created the patch, really tough :)

    I've got a couple of questions, though:

    1) Are there any tests/specs that for the plugin in general? I know most plugins don't have them, but kind of expected them here ;)

    2) How should this handle backwards compatibility? Removing the formatted_ works in edge/2.3, but doesn't work in 2.2?

    Anyway, I'll through my pull request out there, for now. This is one of my first contributions to an open-source project, so feel free to kick me if I'm doing this all wrong.


  • Rick

    Rick January 6th, 2009 @ 06:10 PM

    It generates its tests. Thanks for the patch, but it should really be in a branch for edge rails. There's no way I'm going to break the plugin for some edge change. Edge tends to get new features before adding the deprecations that go into the stable releases.

  • Trey Bean

    Trey Bean January 6th, 2009 @ 07:25 PM

    Ah, I was wondering why that wasn't deprecated in rails 2.2. I guess the deprecation/backwards compatibility will come. Thanks.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Restful Authentication Generator

This widely-used plugin provides a foundation for securely managing user
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.


People watching this ticket